
## frpc



#docker rmi -f ubuntu:21.10
docker pull ubuntu:21.10
rm -rf /cardone/docker/images/ubuntu_21.10.tar
mkdir -p /cardone/docker/images
docker save ubuntu:21.10 > /cardone/docker/images/ubuntu_21.10.tar
#docker load < /cardone/docker/images/ubuntu_21.10.tar



mkdir -p /cardone/temps/frpc
chmod -R 777 /cardone/temps/frpc

(
cat << 'EOF'
FROM ubuntu:21.10

LABEL description=frpc

WORKDIR /cardone/middlewares/frpc

ADD frp_0.42.0_linux_amd64.tar.gz /cardone/middlewares/

RUN cp /cardone/middlewares/frp_0.42.0_linux_amd64/frpc* /cardone/middlewares/frpc

RUN rm -rf /cardone/middlewares/frp_0.42.0_linux_amd64

ENTRYPOINT ./frpc -c ./frpc.ini
EOF
) > /cardone/temps/frpc/Dockerfile

cd /cardone/temps/frpc

docker build -t frpc:1.0.0 .

docker tag frpc:1.0.0 cardone:5000/frpc:1.0.0
docker push cardone:5000/frpc:1.0.0




############################################################



docker node update --label-rm cardone-frpc-2_frpc-2 cardone-01-01
docker node update --label-add cardone-frpc-2_frpc-2=true cardone-01-01

docker stack rm cardone-frpc-2

docker stack deploy -c /cardone/middlewares/frpc-2/prod.yml cardone-frpc-2

for i in {1..10}  
do  
sleep $i

docker stack ps cardone-frpc-2

docker service ls
done

docker service logs cardone-frpc-2_frpc-2 -f --tail 300
